package com.ddwl.schema.vo.funds;

import cn.hutool.crypto.SecureUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 类PayInfoVo.java的实现描述：支付返回信息
 *
 * @author zach
 * @Date :2020-06-02 17:13.
 */
@Data
@ApiModel("微信小程序支付返回信息")
public class WxPaymentInfoVo {
    @ApiModelProperty("小程序ID")
    private String appId;
    @ApiModelProperty("签名")
    private String sign;
    @ApiModelProperty("时间戳")
    private String timeStamp;
    @ApiModelProperty("随机串")
    private String nonceStr;
    @ApiModelProperty("支付isd")
    private String prepayId;
    @ApiModelProperty("商户号")
    private String partnerid;
    @ApiModelProperty("微信签名方式")
    private String signType;

    public void jsApiMd5Sign(String key) {
        String str = "appId=" + appId +
                "&nonceStr=" + nonceStr +
                "&package=" +
                "prepay_id=" + prepayId +
                "&signType=" + signType +
                "&timeStamp=" + timeStamp +
                "&key=" + key;
        this.sign = SecureUtil.md5(str);
    }
}
